package com.evil.common.application.dto.robot;

import com.evil.common.application.dto.SourceDTO;
import com.evil.common.application.enums.robot.RobotSourceTypeEnum;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotNull;

/**
 * 机器人源类型
 *
 * @author liyang
 * @date 2022-08-08 00:00
 */
@Data
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
public class RobotSourceDTO extends SourceDTO {

    @NotNull(message = "version not null")
    private Integer version;

    private Integer robotStatus;

    private Integer firstTriggerType;

    public RobotSourceDTO(@NotNull(message = "源类型不能为空") Integer sourceType, @NotNull(message = "源id不能为空") Long sourceId, Integer version) {
        super(sourceType, sourceId);
        this.version = version;
    }

    public RobotSourceDTO(RobotSourceTypeEnum sourceTypeEnum, Long sourceId) {
        super(sourceTypeEnum.getId(), sourceId);
    }

    public RobotSourceDTO(RobotSourceTypeEnum sourceTypeEnum, Long sourceId, Integer version) {
        super(sourceTypeEnum.getId(), sourceId);
        this.version = version;
    }
}
